package com.tandn.activity.show;

import com.tandn.AppMain;
import com.tandn.R;
import com.tandn.models.ATM;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class ShowListAcitvity extends Activity
{
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.show_list);

		final TextView textBankName = (TextView) findViewById(R.id.textBank);
		final TextView textBankAddress = (TextView) findViewById(R.id.textBankAddress);
		final TextView textResultsList = (TextView) findViewById(R.id.textResultsList);

		textBankName.setText(getString(R.string.textViewBank) + " "
				+ AppMain._bankName);

		String textResultsBig = "";
		if (AppMain._listATMSearchWithDistrict != null)
		{
			textBankAddress.setText(getString(R.string.textViewDistrict) + " "
					+ AppMain._listATMSearchWithDistrict.get(0).getDistrict()
					+ ", " + getString(R.string.textViewCity) + " "
					+ AppMain._listATMSearchWithDistrict.get(0).getCity());
			for (ATM atm : AppMain._listATMSearchWithDistrict)
			{
				textResultsBig += atm.getPlace() + "\n";
			}

		} else
		{
			textBankAddress.setText(getString(R.string.textViewCity) + " "
					+ AppMain._listATMSearchWithCity.get(0).getCity());
			for (ATM atm : AppMain._listATMSearchWithCity)
			{
				textResultsBig += atm.getPlace() + "\n";
			}

		}
		textResultsList.setText(textResultsBig);
	}
}
